package cn.edu.nju.oraldefense.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import cn.edu.nju.oraldefense.dao.GraduateDao;
import cn.edu.nju.oraldefense.dao.GraduateOperationDao;
import cn.edu.nju.oraldefense.model.Graduate;
import cn.edu.nju.oraldefense.model.GraduateOperation;
import cn.edu.nju.oraldefense.service.GraduateOperationService;

@Component("graduateOperationService")
public class GraduateOperationServiceImpl implements GraduateOperationService {

	private GraduateOperationDao graduateOperationDao;

	public GraduateOperationDao getGraduateOperationDao() {
		return graduateOperationDao;
	}

	@Resource
	public void setGraduateOperationDao(
			GraduateOperationDao graduateOperationDao) {
		this.graduateOperationDao = graduateOperationDao;
	}

	public void addOperation(GraduateOperation operation) {
		graduateOperationDao.save(operation);
	}

	public List getByGraduateAndTypeAndMonth(Graduate graduate, int type,
			String yearmonth, String nextyearmonth) {
		return graduateOperationDao.findByGraduateAndTypeAndMonth(graduate,
				type, yearmonth, nextyearmonth);
	}

}
